<template>
	<app-layout>
		<view class="mine tn-safe-area-inset-bottom">

			<!-- 顶部自定义导航 -->
			<tn-nav-bar>我的信息</tn-nav-bar>

			<view class="" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
				<!-- 图标logo/头像 -->

				<!-- improtant-->
				<view class="tn-bg-white">

					<!-- 我的信息  编辑-->

					<view class="tn-padding">
						<tn-form :model="userinfo" :labelWidth="170" ref="uForm" :errorType="['message']">
							<tn-form-item label="姓名" prop="intro" v-if="userinfo.FstaffName">
								<tn-input v-if="edit" v-model="userinfo.FstaffName" placeholder='FstaffName' />
								<view v-else>{{userinfo.FstaffName}}</view>
							</tn-form-item>
							<tn-form-item label="账号" prop="FUserName">
								<tn-input v-if="edit" v-model="userinfo.FUserName" placeholder='FUserName' />
								<view v-else>{{userinfo.FUserName}}</view>
							</tn-form-item>
							<tn-form-item label="组织" prop="FUserGroup" v-if="userinfo.FUserGroup">
								<tn-input v-if="edit" v-model="userinfo.FUserGroup" placeholder='FUserGroup' />
								<view v-else>{{userinfo.FUserGroup}}</view>
							</tn-form-item>


							<tn-form-item label="组织ID" prop="Fstaffld" v-if="userinfo.Fstaffld">
								<tn-input v-if="edit" v-model="userinfo.Fstaffld" placeholder='Fstaffld' />
								<view v-else>{{userinfo.Fstaffld}}</view>
							</tn-form-item>
						
						</tn-form>

					</view>
				</view>
			</view>

			<!-- 		<bottom-btn v-if="!edit" @save="save" subtext="修改" @submit="edit=true"></bottom-btn>
			<bottom-btn v-if="edit" :showsave="true"  @save="getinfo" savetext="退出" @submit="submit"></bottom-btn> -->
			<view class='tn-tabbar-height'></view>

		</view>
	</app-layout>
</template>

<script>
	import {
		mapGetters,
		mapState
	} from 'vuex';
	export default {
		name: 'info',
		// 必须要在onReady生命周期，因为onLoad生命周期组件可能尚未创建完毕
		onReady() {
			this.$refs.uForm.setRules(this.rules);
		},
		data() {
			return {
				xduser: '',
				setting: {
					sourceType: ['camera'],
					showUploadList: true
				},
				photo: '',
				action: this.$api.upload.index,
				formData: {},
				sexlist: [{
						name: '男',
						disabled: false
					},
					{
						name: '女',
						disabled: false
					}
				],
				rules: {
					name: {

					}
				},

				sexShow: false,
				edit: false
			}
		},

		computed: {
			...mapState({
				userinfo: state => state.userinfo,
			})
		},
		onShow() {
			this.$user.getInfo()

		},
		methods: {
			upsuccess(data) {

				this.photo = data.url;
			},
			uperror(e) {
				this.$t.message.toast(e.msg)
			},
			upchange(e) {},


			submit() {}
		}
	}
</script>

<style lang="scss" scoped>
	.mine {
		max-height: 100vh;
	}

	/* 底部安全边距 start*/
	.tn-tabbar-height {
		min-height: 120rpx;
		height: calc(140rpx + env(safe-area-inset-bottom) / 2);
		height: calc(140rpx + constant(safe-area-inset-bottom));
	}

	.tn-color-cat {
		color: #1D2541;
	}

	.tn-bg-cat {
		background-color: #1D2541;
	}

	.title {
		padding: 26rpx 30rpx;
	}

	.list-icon-text,
	.list-image-text {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.list {
		&__left {
			display: flex;
			align-items: center;
			justify-content: flex-start;

			&__icon,
			&__image {
				margin-right: 18rpx;
			}
		}

		&__right {
			display: flex;
			align-items: center;
			justify-content: flex-end;
		}
	}

	/* 自定义导航栏内容 start */
	.custom-nav {
		height: 100%;

		&__back {
			margin: auto 5rpx;
			font-size: 40rpx;
			margin-right: 10rpx;
			flex-basis: 5%;
			width: 100rpx;
			position: absolute;
		}
	}

	/* 自定义导航栏内容 end */


	/* 顶部背景图 end */


	/* 用户头像 start */
	.logo-image {
		width: 110rpx;
		height: 110rpx;
		position: relative;
		overflow: hidden;
		border-radius: 50%;
	}

	.logo-pic {
		background-size: cover;
		background-repeat: no-repeat;
		// background-attachment:fixed;
		background-position: top;
		border: 8rpx solid rgba(255, 255, 255, 0.05);
		box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.15);
		border-radius: 50%;
		overflow: hidden;
		// background-color: #FFFFFF;
	}




	.avatar {
		width: 100rpx;
		height: 100rpx;
		border-radius: 50%;
	}

	/* 图标容器1 end */


	/* 顶部背景图 start */
	.top-backgroup {
		height: 450rpx;
		z-index: -1;

		.backgroud-image {
			width: 100%;
			height: 450rpx;
			// z-index: -1;
		}
	}

	/* 顶部背景图 end */
</style>